import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:honeypotflutter/publicBussine/bussine_image.dart';
import 'package:honeypotflutter/publicBussine/loginInfo/bussine_userInfo.dart';
import 'package:honeypotflutter/publicBussine/view/bussine_item.dart';
import 'package:honeypotflutter/public/views/public_appBar.dart';
import 'package:honeypotflutter/public/views/public_scrollView.dart';
import 'logic.dart';

class MineInfoPage extends StatefulWidget {
  const MineInfoPage({Key? key}) : super(key: key);

  @override
  State<MineInfoPage> createState() => _MineInfoPageState();
}

class _MineInfoPageState extends State<MineInfoPage> {
  final MineInfoLogic logic = Get.put(MineInfoLogic());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: HLAppBar(navigationTitle: "个人信息"),
      body: GetBuilder<UserInfoLogic>(
          init: UserInfoLogic(),
          builder: (controller) {
            return HLScrollView(children: [
              MGItems(
                padding: EdgeInsets.all(15),
                leadTitle: controller.userInfo.realName,
                // trailingTitle: "",
                trailingWidget: Image.asset(MGImage.image("public_photo", type: ImagePathType.public), width: 45),
              ),
              MGItems(
                padding: EdgeInsets.all(15),
                leadTitle: "身份证",
                trailingTitle: controller.userInfo.idCardNumber,
              ),
              MGItems(
                padding: EdgeInsets.all(15),
                leadTitle: "所在城市",
                trailingTitle: controller.userInfo.tmcWeixinInfo?.province,
              ),
              MGItems(
                padding: EdgeInsets.all(15),
                leadTitle: "手机号码",
                trailingTitle: controller.userInfo.phoneNumber,
              ),
              MGItems(
                padding: EdgeInsets.all(15),
                margin: EdgeInsets.only(top: 15),
                leadTitle: "所属公司",
                trailingTitle: controller.userInfo.tmcCourierCompanyAbbreviation,
              ),
              MGItems(
                padding: EdgeInsets.all(15),
                leadTitle: "工号",
                trailingTitle: controller.userInfo.identificationNumber,
              ),
              MGItems(padding: EdgeInsets.all(15), leadTitle: "网点编号"),
            ]);
          }),
    );
  }

  @override
  void dispose() {
    Get.delete<MineInfoLogic>();
    super.dispose();
  }
}
